SYSWRITE=4

.globl mywrite, myadd

.text
#;_mywrite: ; 如果fedora9以下，将此行注释打开
mywrite: #; fedora 9以上，不要下划线
	pushl %ebp
	movl %esp, %ebp
	pushl %ebp

	movl 8(%ebp), %ebx
	movl 12(%ebp), %ecx
	movl 16(%ebp), %edx
	movl $SYSWRITE, %eax
	int $0x80
	popl %ebx
	movl %ebp, %esp
	popl %ebp
	ret

#; _myadd: ;如果fedora9以下，将此行注释打开
myadd: #; fedora 9以上，不要下划线
	pushl %ebp
	movl %esp, %ebp
	movl 8(%ebp), %eax
	movl 12(%ebp), %edx
	xorl %ecx, %ecx
	addl %eax, %edx
	jo 1f
	movl 16(%ebp), %eax
	movl %edx, (%eax)
	incl %ecx
1:
	movl %ecx, %eax
	movl %ebp, %esp
	popl %ebp
	ret
